package com.skin.tools;

import com.skin.admin.entity.Result;

/**
 * Created by Administrator on 2018/8/2 0002.
 */
public class ResultUtil {

    /**
     *
     * 成功 写入数据
     * @param object
     * @return
     */
    public static Result success(Object object) {
        return new Result(1, "成功", object);
    }
    /**
     *成功 自定义信息
     */
    public static Result success(String msg,Object object) {
        return new Result(1, msg, object);
    }

    /**
     * 自定义状态 ----失败
     * @param code
     * @param msg
     * @return
     */
    public static Result error(Integer code, String msg) {
        return new Result(code, msg,null);
    }

    /**
     * 直接返回失败
     * @return
     */
    public static Result error() {
        return new Result(0, "失败",null);
    }

    /**
     * 失败  信息写入
     * @param msg
     * @return
     */
    public static Result error(String msg) {
        return new Result(0, msg,null);
    }
}
